package pl.edu.mimuw.irs.rcp.controller.editor.input;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;

import pl.edu.mimuw.irs.core.model.petrinet.workflow.Workflow;
import pl.edu.mimuw.irs.rcp.controller.editor.TokenGameEditor;

/**
 * @author Jakub Rauch
 * Created on: 2009-05-27
 */
public class TokenGameEditorInput implements IEditorInput {

	// *** Attributes

	private Workflow workflow;
	public Workflow getWorkflow() {
		return workflow;
	}
	public void setWorkflow(Workflow workflow) {
		this.workflow = workflow;
		// TODO : Token game albo do poprawy albo do wywalenia.
		workflow.getIn().setTokens(1);
	}
	
	// *** Methods

	@Override
	public boolean exists() {
		return true;
	}

	@Override
	public ImageDescriptor getImageDescriptor() {
		// XXX Auto-generated method stub
		return null;
	}

	@Override
	public String getName() {
		// XXX Auto-generated method stub
		//return null;
		return "name...";
	}

	@Override
	public IPersistableElement getPersistable() {
		return null;
	}

	@Override
	public String getToolTipText() {
		// XXX Auto-generated method stub
		return "Tooltip...";
	}

	@SuppressWarnings("unchecked")
	@Override
	public Object getAdapter(Class adapter) {
		// XXX Auto-generated method stub
		return TokenGameEditor.class;
	}
}
